/***************************************************************************
 *   Copyright (C) 2009 by Bernhard Neuhofer   *
 *   mail@bneu.at   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#include "gvtStats.h"
#include <limits>
#include <iostream>
#include "../tools/log.h"

using namespace std;


bool GvtStats::getColor()
{
	return _color;
}

int GvtStats::getMd ( bool color )
{
	return _color?_mdw:_mdr;
}

double GvtStats::getLvtSm()
{
	return _lvtSm;
}

double GvtStats::getTmin()
{
	return _tmin;
}

double GvtStats::getGvt()
{
	return _gvt;
}

void GvtStats::changeColor()
{
	_color=!_color;
}

void GvtStats::setColor ( bool color )
{
	FILE_LOG(logDEBUG)<<"setcolor1:"<<color<<endl;
	FILE_LOG(logDEBUG)<<"setcolor1:"<<_tmin<<endl;
	_color=color;
	FILE_LOG(logDEBUG)<<"setcolor2"<<endl;
}

void GvtStats::incMd ( bool color )
{
	if ( color )
		_mdw++;
	else
		_mdr++;
}


void GvtStats::decMd ( bool color )
{
	if ( color )
		_mdw--;
	else
		_mdr--;
}

void GvtStats::setMd ( bool color, int md )
{
	if ( color )
		_mdw=md;
	else
		_mdr=md;
}

void GvtStats::resetMd ( bool color )
{
	if ( color )
		_mdw=0;
	else
		_mdr=0;
}

void GvtStats::setLvtSm ( double lvtSm )
{
	_lvtSm=lvtSm;
}

void GvtStats::resetTmin()
{
	_tmin=std::numeric_limits<double>::max();
}

void GvtStats::setTmin ( double tmin )
{
	_tmin=tmin;
}

void GvtStats::setGvt ( double gvt )
{
	_gvt=gvt;
}
